package com.sudichina.sudichina.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by mccccccmike on 2017/2/14.
 */

public class Address implements Parcelable {
    private String id;
    private Long accountId;  //用户Id
    private Long zoneId; //城市Id
    private Long zoneCode; //收货人地区编码
    private String laLoPosition;  //地图经度，纬度
    private String realName; //收货人姓名
    private String conTel; //联系电话
    private String streetName; //街道地址
    private String distressCall; //紧急电话
    private String detailAddress; //地址详情
    private Boolean isDefault; //默认地址，每个账户只有一个默认地址状态有效
    private String reason;  //备注
    private Boolean isUse;  //是有有效
    private String conMail;  //邮箱
    private String payMethod; //支付方式

    public Address(Long accountId, String id, String realName, String conTel, String detailAddress) {
        this.id = id;
        this.accountId = accountId;
        this.realName = realName;
        this.conTel = conTel;
        this.detailAddress = detailAddress;
    }

    public Address(Long accountId, String realName, String conTel, String detailAddress, boolean isDefault) {
        this.accountId = accountId;
        this.realName = realName;
        this.conTel = conTel;
        this.detailAddress = detailAddress;
        this.isDefault = isDefault;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Long getAccountId() {
        return accountId;
    }

    public void setAccountId(Long accountId) {
        this.accountId = accountId;
    }

    public Long getZoneId() {
        return zoneId;
    }

    public void setZoneId(Long zoneId) {
        this.zoneId = zoneId;
    }

    public Long getZoneCode() {
        return zoneCode;
    }

    public void setZoneCode(Long zoneCode) {
        this.zoneCode = zoneCode;
    }

    public String getLaLoPosition() {
        return laLoPosition;
    }

    public void setLaLoPosition(String laLoPosition) {
        this.laLoPosition = laLoPosition;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getConTel() {
        return conTel;
    }

    public void setConTel(String conTel) {
        this.conTel = conTel;
    }

    public String getStreetName() {
        return streetName;
    }

    public void setStreetName(String streetName) {
        this.streetName = streetName;
    }

    public String getDistressCall() {
        return distressCall;
    }

    public void setDistressCall(String distressCall) {
        this.distressCall = distressCall;
    }

    public String getDetailAddress() {
        return detailAddress;
    }

    public void setDetailAddress(String detailAddress) {
        this.detailAddress = detailAddress;
    }

    public Boolean getDefault() {
        return isDefault;
    }

    public void setDefault(Boolean aDefault) {
        isDefault = aDefault;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public Boolean getUse() {
        return isUse;
    }

    public void setUse(Boolean use) {
        isUse = use;
    }

    public String getConMail() {
        return conMail;
    }

    public void setConMail(String conMail) {
        this.conMail = conMail;
    }

    public String getPayMethod() {
        return payMethod;
    }

    public void setPayMethod(String payMethod) {
        this.payMethod = payMethod;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeValue(this.accountId);
        dest.writeValue(this.zoneId);
        dest.writeValue(this.zoneCode);
        dest.writeString(this.laLoPosition);
        dest.writeString(this.realName);
        dest.writeString(this.conTel);
        dest.writeString(this.streetName);
        dest.writeString(this.distressCall);
        dest.writeString(this.detailAddress);
        dest.writeValue(this.isDefault);
        dest.writeString(this.reason);
        dest.writeValue(this.isUse);
        dest.writeString(this.conMail);
        dest.writeString(this.payMethod);
    }

    protected Address(Parcel in) {
        this.id = in.readString();
        this.accountId = (Long) in.readValue(Long.class.getClassLoader());
        this.zoneId = (Long) in.readValue(Long.class.getClassLoader());
        this.zoneCode = (Long) in.readValue(Long.class.getClassLoader());
        this.laLoPosition = in.readString();
        this.realName = in.readString();
        this.conTel = in.readString();
        this.streetName = in.readString();
        this.distressCall = in.readString();
        this.detailAddress = in.readString();
        this.isDefault = (Boolean) in.readValue(Boolean.class.getClassLoader());
        this.reason = in.readString();
        this.isUse = (Boolean) in.readValue(Boolean.class.getClassLoader());
        this.conMail = in.readString();
        this.payMethod = in.readString();
    }

    public static final Creator<Address> CREATOR = new Creator<Address>() {
        @Override
        public Address createFromParcel(Parcel source) {
            return new Address(source);
        }

        @Override
        public Address[] newArray(int size) {
            return new Address[size];
        }
    };
}
